const encrypt = require('./encrypt');
// 私钥加密 公钥解密
const a = encrypt.rsaEncrypt('a')
console.log(a, '\n');
const unbase64 = Buffer.from(a, 'base64')
// console.log(unbase64, '\n')
console.log(encrypt.rsaPublicDecrypt(unbase64).toString())

console.log('----------------\n')
// 公钥加密，私钥解密
const b = encrypt.rsaPublicEncrypt('a')
console.log(b, '\n');
const unbase64b = Buffer.from(b, 'base64')
// console.log(unbase64b, '\n')
console.log(encrypt.rsaDecrypt(unbase64b).toString())